﻿@{
    Layout = null;  
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>HuiJiTong：惠集通信息管理平台</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="/Content/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/Content/AdminLTE/css/font-awesome.min.css">
    <link rel="stylesheet" href="/Content/AdminLTE/css/AdminLTE.min.css">
    <!--element UI-->
    @*<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">*@
    <link rel="stylesheet" href="/Content/AdminLTE/css/index.css">
    <link href="~/Content/element/element-custom.css" rel="stylesheet" />
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body class="hold-transition login-page ">
    <div id="app" class="login-box">
        <div class="login-logo">
            <a href="/Account/Login"><b>惠集通</b>平台</a>
        </div>
        <!-- /.login-logo -->
        <div class="login-box-body">
            <p class="login-box-msg">登 录</p>
            <form action="/Account/Login" method="post">
                <div class="form-group has-feedback">
                    <input type="text" class="form-control" name="userName" placeholder="账 号/工 号" v-model="userName">
                    <span class="glyphicon glyphicon-user form-control-feedback"></span>
                </div>
                <div class="form-group has-feedback">
                    <input type="password" class="form-control" name="password" placeholder="密 码" v-model="password">
                    <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                </div>
                <div class="row">
                    <div class="col-xs-8">
                        <div class="checkbox icheck">
                            <label>
                                @*<input type="checkbox" v-model="remmberMe">*@ 
                                <el-checkbox v-model="rememberMe" size="medium">记住账号</el-checkbox>
                            </label>
                        </div>
                    </div>
                    <!-- /.col -->
                    <div class="col-xs-4">
                        <input type="hidden" v-model="returnUrl" />
                        <button type="submit" class="btn btn-primary btn-block btn-flat" v-on:click.prevent="Login">登 录</button>
                    </div>
                    <!-- /.col -->
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <span class="text-danger">{{errorMsg}}</span>
                    </div>
                </div>
            </form>
        </div>
        <!-- /.login-box-body -->
    </div>
    <!-- /.login-box -->
    <!-- jQuery 2.2.3 -->
    <script src="/Scripts/jquery-2.1.3.min.js"></script>
    <!-- Bootstrap 3.3.6 -->
    <script src="/Scripts/bootstrap.min.js"></script>
    <script src="/Scripts/vue.min.js"></script>
    <!--element js-->
    @*<script src="https://unpkg.com/element-ui/lib/index.js"></script>*@
    <script src="/Content/AdminLTE/js/index.js"></script>
    <script>
        var vue = new Vue({
            el: "#app",
            data: {
                userName: "",
                password: "",
                rememberMe: false,
                errorMsg: '',
                validateCode: '',
                returnUrl: '@ViewBag.ReturnUrl',
            },
            methods: {
                Login: function () {
                    var self = this;
                    $.post("/Account/Login", { UserName: self.userName, Password: self.password, RememberMe: self.rememberMe }, function (result) {
                        if (result.success) {
                            //alert(result.returnUrl);
                            // window.location.href = result.returnUrl;
                            top.location.href = result.returnUrl;
                            //alert(top.location.href);
                        }
                        else {
                            self.errorMsg = result.error;
                        }
                    }, "json");
                }
            }
        });
    </script>
</body>
</html>


